TEXPrt

A front-end for printing DVI files

Version 3.00

March 05, 1994

by Richard Bödi

Abstract

TEXPrt is a MUI driven front end for DVI printer drivers. It is highly configurable and can be used with various DVI printer drivers such as DVIPrint (PasTeX by Georg Heßmann), DVILJP (Amiga-TeX) and many others. TEXPrt allows you to easily select the pages you want to print (whole document, from page # to page #, odd pages, even pages), the number of copies, landscape or portrait printing mode, horizontal and vertical offsets, reverse printing of the pages, and ten more user definable options. DVI printer drivers are defined by (ASCII) specification files. TEXPrt has an ARexx port and interprets 17 commands.

Contents

1. Copyright . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

3. Running TEXPrt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 3.1. Running TEXPrt from the CLI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 3.2. Running TEXPrt from Workbench . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

3.2.1. SHELL Tooltype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 3.2.2. APPICON Tooltype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

4. Selecting a DVI file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

5. The DVI driver specification file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

6. The ”texprint” environment variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

7. Menu description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 7.1. The Config menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 7.2. The Drivers menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

8. ARexx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 8.1. The TexPrtInit.tpr and TexPrtPrint.tpr macro files . . . . . . . . . . . . . . . . . . . . 7 8.2. ARexx commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

9. Required software and hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

10. History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

1. Copyright

TEXPrt is a “freely distributable copyrighted software”, i e. everyone may copy and use it, but the copyright remains by myself (Richard Bödi).

TEXPrt may not be sold commercially without permission. It may not be part of any PD series except Fred Fish’s AmigaLibDisks. Permission to modify the software is granted, but not the right to distribute the modified code or only part of the files.

Thanks go to Georg Heßmann for writing the PasTeX implementation (I really enjoy it), Michael Balzer for designing ARexxBox (saved me a lot of time), and Stefan Stuntz for his great Magic User Interface (MUI). Last not least I want to thank Fred Fish for the continuing release of his library disks. For me, the quality of Fred’s library disks has been one important reason for buying an Amiga. And I never have repented it.

2. Introduction

TEXPrt is a front end for DVI printer drivers, i. e. it allows the user to control DVI printer drivers via a graphical user interface. The GUI is based on Stefan Stuntz’s Magic User Ibterface. TEXPrt supports the selection of the pages (whole document, from page # to page #, odd pages, even pages), the number of copies, landscape or portrait printing mode, horizontal and vertical offsets, and provides ten more user definable options.

3. Running TEXPrt

The TEXPrt program can either be executed in a shell using parameters or from Workbench using ToolTypes. When launched from Worbench, a DVI file can be selected by first selecting the TEXPrt icon, holding the SHIFT key, and double clicking the desired DVI file. Having started TEXPrt, the program first looks for DVI driver specification files located in a subdrawer named TeXDrivers. If this drawer is empty or contains no valid specification file, the program exits with an error message. For more information on DVI driver specification files see the appropriate chapter below.

3.1. Running TEXPrt from the CLI

Format: TeXPrt [SHELL<Device>] [APPICON<Name of AppIcon>] [FILE<DVI
file>]
Pattern: TeXPrt SHELL/K, APPICON/K, FILE/K

Description of the command line options:

SHELL Specifies the shell from which the DVI printer driver should be launched.

        Example: SHELL=newwsh CNC:20/340/660/150/TeXPrt-Output invokes

the DVI printer driver from WShell using the CNC: device (a CNC: shell window has a scrollbar on the left). The default setting is newshell

        CON:0/0/640/150/TeXPrint-Output.

Note that you must not specify the SCREEN parameter in the

shell!  This is done by the SCREEN command.  So don’t

        use SHELL=CON://400/50/Title/SCREENShowDVI-PubScr, e. g., use
        SCREEN=ShowDVI-PubScr SHELL=CON://400/50/Title instead.

APPICON Name of the AppIcon icon file (which must reside in the same directory as the TEXPrt program). If no name is specified, no AppIcon will be generated.

FILE The DVI file which should be printed.

3.2. Running TEXPrt from Workbench

When running TEXPrt from Worbench a DVI file can be selected by first clicking the TEXPrt icon, holding the SHIFT key, and double clicking the desired DVI file. The parameters are specified by ToolTypes which can be edited by the Workbench’s Info command.

3.2.1. SHELL Tooltype

Specifies the shell from which the DVI printer driver should be launched. Note that you must not specify the SCREEN parameter in the shell! This is done by the

SCREEN command. So don’t use SHELL=CON://400/50/Title/SCREENShowDVI-
PubScr, e. g., use SCREEN=ShowDVI-PubScr SHELL=CON://400/50/Title instead.

3.2.2. APPICON Tooltype

Name of the AppIcon icon file (which must reside in the same directory as the TEXPrt program). If no name is specified, no AppIcon will be generated.

4. Selecting a DVI file

A DVI file can be selected in six different ways.

• During startup from a shell using the FILE keyword.

• During startup from Workbench by first selecting the TEXPrt icon, holding the SHIFT key, and double clicking the desired DVI file.

• During runtime by selecting the string gadget named ”DVI file” and typing the name of the DVI file.

• During runtime by pushing the GetFile gadget on the right of the ”DVI file” string gadget. The ASL file requester will appear and you may choose your DVI file.

• If TEXPrt opens its window on the Workbench screen, icons can be dragged into TEXPrt’s window. The name of the dragged icon (including its path) is copied into the ”DVI file” string gadget.

• If you specified an AppIcon icon file, TEXPrt creates an AppIcon from that icon file, where other icons can be dragged onto. The name of the dragged icon (including its path) is copied into the ”DVI file” string gadget.

Remark: Since version 3.0 of TEXPrt uses the MUI, the SCREEN tooltype is obsolete. Use the MUIPrefs program instead to specify the screen on which TEXPrt should appear.

5. The DVI driver specification file

The information about the available DVI printer drivers is stored in DVI driver specification files located in a subdrawer named TeXDrivers. During startup TEXPrt scans this directory and looks for these specification files. For every valid specification file an entry in the Drivers menu is created. If the TeXDrivers drawer is empty or contains no valid specification file, the program exits with an error message. An example specification file for the DVIPrint printer driver (PasTeX) is given below. All entries are separated by a semicolon. While reading a specification file, every double quote will be substituted by a white space. This is important, because some DVI drivers take their arguments without a space (-f1 -t10, e.g.), while others expect one (-f 1 -t 10, e.g.). Two consecutive double quotes indicate that the corresponding command is not supported by the printer driver (see Copies in the example below, e.g.) or that no command switch is necessary (see Device in the example below). If a command is not supported by the printer driver, TEXPrt disables the appropriate gadget on its window.

TeXPrt printer driver spec file
Name ; DVIPrint
Node ; Typesetting:Pastex/bin/DVIPrint
PageSel (DOCUMENT/FROMTO) ; DOCUMENT ; -f",-t",""
Copies ; 1 ; ""
PageType (ALL/ODD/EVEN) ; ALL ; "",-1,-2
Reverse (ON/OFF) ; OFF ; -r
Orientation (PORTRAIT/LANDSCAPE) ; PORTRAIT ; "",-g
HOffset ; 0 ; -h" ; truemm ; mm
VOffset ; 0 ; -v" ; truemm ; mm
AdjHOffset ; 18
AdjVOffset ; 16
Option1 (ON/OFF) ; OFF ; -r ; Reverse
Option2 (ON/OFF) ; OFF ; DRAft ; Draft
Option3 (ON/OFF) ; ON ; -o ; Optimize
Option4 (ON/OFF) ; ON ; -T ; Fast
Option5 (ON/OFF) ; OFF ; -i ; IFF-ILBM
Option6 (ON/OFF) ; OFF ; "" ; ""
Option7 (ON/OFF) ; OFF ; "" ; ""
Option8 (ON/OFF) ; OFF ; "" ; ""
Option9 (ON/OFF) ; OFF ; "" ; ""
Option10 (ON/OFF) ; OFF ; "" ; ""
Device ; par:  ; OUTTo=
DVIFile ; ""
Misc ; ""

The first line is used to indicate that this is a DVI driver specification file (needed while scanning the TeXDrivers drawer). Name specifies the string which will appear in the Drivers menu. Node contains the filename of the printer driver including the full path. The path can be omitted if the printer driver is accessible via a global path. The first entry after PageSel (DOCUMENT/FROMTO) specifies the default setting when this spec file is read by TEXPrt. The second entry contains the parameters (actually 3 parameters separated by a comma) of the printer driver to specify from which page (-f) upto which page (-t) should be printed. The third parameter which is not used (marked by ””) in the file above determines the number of pages that should be printed. Some printer driver use such kind of parameter instead of specifying the last printed page directly (see the AmigaTeX spec file that comes with this program). Note that parameter strings may not contain any white space (use a double quote instead). The Copies keyword determines the number of copies that should be printed. Note that, although the DVIPrint printer driver does not support printing multiple copies of one file, this feature is emulated by TEXPrt by repeatedly launching the printer driver with the same DVI file. PageType (ALL/ODD/EVEN) sets the type of pages that should be printed. Again the first entry specifies the default setting while the second contains the parameter string (in the example above there is no parameter for specifying ALL pages). Orientation (PORTRAIT/LANDSCAPE) determines the orientation of the printout. HOffset and VOffset specify the horizontal and vertical offset of the printout. The third entry of these lines specify the unit measures of the offsets. The strings of the last entries will be displayed on the right side of the HOffset and VOffset string gadgets, respectively. They don’t affect the behaviour of the printout. Example, HOffset ; -5 ; -h” ; truemm ; mm produces the command line -h -5truemm) and writes the string ”mm” to the right side of the HOffset string gadget. AdjHOffset and AdjVOffset are used to preadjust the horizontal and vertical offsets. This is necessary, because on different printers the margins may be different too. TEXPrt simply adds AdjHOffset to HOffset and AdjVOffset to VOffset and these sums are used as offsets when the printer driver is called. The next ten lines Option# (ON/OFF) define user configurable boolean gadgets. The first two entries set up the default state of the boolean gadget and the parameter string. The last entry is used as a label for the gadget. The next line of the spec file which starts with Device determines the output device (for example, par:) and the parameter string. DVIFile specifies the keyword for a DVI file (FILE, for example). Finally, the Misc entry may contain an arbitrary string. This is used in the postscript driver spec file postlj.drv to add the init file

init.ps.

6. The ”texprint” environment variable

To determine which printer driver should be preloaded when starting TEXPrt, the environment variable TEXPRINT is used. Example: setenv TEXPRINT "DVIPrint" sets the DVIPrint driver as the default driver. If the environment variable TEXPRINT is not set or if the specified printer driver cannot be found in the TeXDrivers directory, the first entry which has been scanned is preloaded.

7. Menu description

The TEXPrt program has two menus, namely the Config menu and the Drivers menu.

\underline{8. ARexx 7}

7.1. The Config menu

Save Saves the current settings of the GUI to the current printer driver spe-

cification file.

Save As Saves the current settings of the GUI to a user selectable file. This allows you to easily create new specification file. For example, you can define more than one specification file for a single printer driver containing different default values.

About Displays the program version, a brief description of the program and

my address.

Quit What do you think?

7.2. The Drivers menu

Contains the names of all DVI printer driver specification files found in the TeXDrivers drawer. Note that the number of spec files is limited by the vertical size of the screen on which the TEXPrt program will open its window. The maximum length of the driver names is 64, although it may happen that the menu cannot be created with large names of less than 64 characters. In both cases TEXPrt will exit and report that the menu structure could not have been built. So make sure that neither there are too many spec files in the TeXDrivers drawer nor that the driver names are too long.

8. ARexx

TEXPrt has an built-in ARexx port for receiving messages. The name of the port is TEXPRT.1.

8.1. The TexPrtInit.tpr and TexPrtPrint.tpr macro files

There are two ARexx command files named TexPrtInit.tpr and TexPrt-Print.tpr. The first one of these is executed during startup in the case where TEXPrt detects that a message port named TeXPrtPort is already open. The TexPrtPrint.tpr which I have included simply pops to front the public screen and TEXPrt’s window. The second file TexPrtPrint.tpr is executed when you have confirmed the printout. If ARexx is running on your machine this is all what is done when the printout is confirmed. So if you really want to launch the printer driver in this case, you must send TEXPrt the command PRINT via ARexx. I have chosen this mechanism for flexibility reasons. For example, the TexPrtPrint.tpr ARexx macro that comes with this archive looks if the ShowDVI previewer is running, and if so, it requests the current DVI file from the ShowDVI program and sends it to TEXPrt. After that it sends a PRINT command to TEXPrt to launch the printer driver. If ARexx is not running or if you don’t have ARexx (which I can’t believe), the printer driver is launched directly without using ARexx. Please don’t forget to copy these two ARexx scripts to your Rexx: drawer if you are running ARexx. Otherwise, TEXPrt will NOT work!

\underline{8 8. ARexx}

8.2. ARexx commands

There are 18 commands which TEXPrt can interpret:

CONFIG SAVE/S,SAVEAS/K

CONFIG SAVE saves the current setting of the GUI to the current selected printer driver spec file. CONFIG SAVEAS <filename> saves the current setting of the GUI to the giver filename.

COPIES NUMBER/A/N

COPIES <nn> places the number nn of copies into the ”# of Copies” string gadget.

DRIVER NAME/A

DRIVER <name> selects the driver ”name” (as given in the Drivers menu).

DVIFILE FILE/A

DVIFILE <filename> selects the name of the DVI file which should be printed.

FROM TO DOCUMENT/S,FROM/N/K,TO/N/K

FROM TO DOCUMENT selects printing of the whole document. FROM TO FROM <nn> sets the start of printing to page nn. FROM TO TO <nn> sets the end of printing to page nn.

HOFFSET MM/A/N

HOFFSET <nn> sets the horizontal offset to the value nn.

OPTION NUMBER/A/N,ON/S,OFF/S

OPTION # ON selects the appropriate command, OPTION # OFF deselects it. NUMBER is an integer ranging between 1 and 10.

ORIENTATION PORTRAIT/S,LANDSCAPE/S

ORIENTATION PORTRAIT sets portrait printing mode, ORIENTATION LANDSCAPE sets landscape printing mode.

OUTFILE FILE/A

DVIFILE <filename> sets the filename or the output device.

PAGES ALL/S,EVEN/S,ODD/S

PAGES ALL sets the mode of printing to all pages, PAGES EVEN prints only even pages, PAGES ODD only odd pages.

PRINT

PRINT launches the specified printer driver with a set of parameters given by the values of the corresponding gadgets on TEXPrt’s window.

TOFRONT
TOBACK

TOFRONT brings the TEXPrt window to the front, TOBACK will pop it to the back.

SCREENTOFRONT
SCREENTOBACK

SCREENTOFRONT brings the screen on which the TEXPrt window is located to the front, SCREENTOBACK will pop this screen to the back.

QUIT

QUIT quits the program immediately.

VOFFSET MM/A/N

VOFFSET <nn> sets the vertical offset to the value nn.

9. Required software and hardware

• An Amiga, of course.

• A printer, if available.

• Kickstart 2.04 or higher.

• Stefan Stuntz’s Magical User Interface.

• ARexx (optional).

• A proper environment variable (optional).

• A DVI printer driver.

• A DVI file to print.

• A TEXnician (optional).

\underline{10 10. History}

10. History

Version 2.00 First public release. Version 2.01 The format of the DVI Driver specification file has changed for the

HOffset and VOffset items. These items now have four instead of three parameters. The first two are as in Version 2.00. The third one only specifies the keyword which is appended after the offset value. It is no longer displayed on the right side of the Offset string gadgets. Instead, the fourth parameter is taken for that purpose. The fourth parameter is only used for display and doesn’t affect the printout.

Version 3.00 TEXPrt is now a MUI application. The format of the DVI Driver specification file has changed once again. The REVERSE checkmark has been deleted. On the other hand, the number of user definable checkmarks has been raised to ten, so it should be enough buttons left to include the REVERSE option there. The PUBS-CREEN, XPOS, and YPOS tooltypes (parameters) no longer exist. The syntax of the ARexx commands OPTION and QUIT has changed, the semantic of TOBACK and TOFRONT has changed, and two new commands SCREENTOFRONT and SCREENTOBACK have been added.

If you have any remarks (if you like the program or if not) or suggestions for improvements feel free to contact me:

Richard A. Bödi Mathematisches Institut Universität Tübingen Auf der Morgenstelle 10 72076 Tübingen GERMANY

e-mail (Internet) : mmisa01@mailserv.zdv.uni-tuebingen.de